Skip to content

Conversation

@discordianfish
Copy link
Contributor

Summary
Adds support for DRM_FORMAT_RGB565 in DRM frame grabber. This is the DRM format on raspberry pi 4

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated (docs/docs/en)
  • Related tests have been updated

PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD

  • Yes, CHANGELOG.md is also updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@Lord-Grey
Copy link
Collaborator

Lord-Grey commented Nov 21, 2025

@discordianfish Thank you very much for your PR.
Given that the DRM grabber is quite new to me, I wanted to explore how this PR behaves on my rpi4.

I am running trixie and my rpi 4 uses the XR24 linear format.
So I was wondering, if you could start hyperion with extra grabber tracing enabled that I get an idea how your rpi4 responds. That might help me in understanding the variants out there.

Could you start hyperion with extra tracing on:

sudo QT_LOGGING_RULES="grabber.*=true" ./bin/hyperiond -d

For you reference, this is how it looks like at my end:

2025-11-21T15:55:20.790 |__| WEBSOCKET         : <DEBUG> WebSocketJsonHandler.cpp:22:WebSocketJsonHandler() | New WebSocket connection from ::1 initiated via: http://localhost:8090
2025-11-21T15:55:20.804 |__| WEBSOCKET         : <INFO> JSON-API service is ready to process requests
2025-11-21T15:55:21.346 |__| WEBSOCKET         : <DEBUG> JsonAPI.cpp:147:handleInstanceSwitch() | Client '::1' switch to Hyperion instance 0
2025-11-21T15:55:26.048 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::discover()[1037] TID:2043 params:  "{}"

2025-11-21T15:55:26.049 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::getInputDeviceDetails()[995] TID:2043 "DRM device [/dev/dri/card0] found"

2025-11-21T15:55:26.049 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::getInputDeviceDetails()[995] TID:2043 "DRM device [/dev/dri/card1] found"

2025-11-21T15:55:26.050 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::discover()[1068] TID:2043 Discovered input devices: {"default":{"video_input":{"inputIdx":0,"resolution":{"fps":25}}},"device":"drm","device_name":"DRM","type":"screen","video_inputs":[{"formats":[{"resolutions":[{"fps":["1","5","10","15","20","25","30","40","50","60"],"height":2160,"width":3840}]}],"inputIdx":1,"name":"Output 1"}]}

2025-11-21T15:55:50.423 |__| GRABBER-DRM       : <DEBUG> Grabber.cpp:154:setWidthHeight() | Set new width: 3840, height: 2160 for capture
2025-11-21T15:55:50.426 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::isPrimaryPlaneForCrtc()[863] TID:2041 drmModePlane(id: 89, CRTC id: 100, FB id: 724, pos: 0,0, CRTC pos: 0,0, possible CRTCs: 8, gamma size: 0, format count: 35)

2025-11-21T15:55:50.427 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::getFramebuffers()[926] TID:2041 drmModeFB2(id: 724, size: 3840x2160, DRM format: "XR24", DRM modifier: "DRM_FORMAT_MOD_LINEAR", flags: 2, handles: 1000, pitches: 15360000, offsets: 0000)

2025-11-21T15:55:50.428 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::getScreenInfo()[975] TID:2041 "Framebuffer count: 1"

2025-11-21T15:55:50.429 |__| GRABBER-DRM       : <INFO> Capture interface is now enabled
2025-11-21T15:55:50.429 |__| GRABBER-DRM       : <DEBUG> Grabber.cpp:165:setFramerate() | Set new frames per second to: 1 fps, current fps: 25
2025-11-21T15:55:50.430 |__| GRABBER-DRM       : <INFO> Set new frames per second to: 1 fps
2025-11-21T15:55:50.431 |__| GRABBER-BASE      : <INFO> Base grabber started
2025-11-21T15:55:50.432 |__| DAEMON            : <INFO> Base grabber created
2025-11-21T15:55:51.457 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::grabFrame()[599] TID:2041 "Framebuffer ID: 724 - Width: 3840 - Height: 2160  - DRM Format: XR24 - PixelFormat: BGR32, Modifier: DRM_FORMAT_MOD_LINEAR"
...
2025-11-21T15:55:52.445 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::grabFrame()[599] TID:2041 "Framebuffer ID: 724 - Width: 3840 - Height: 2160  - DRM Format: XR24 - PixelFormat: BGR32, Modifier: DRM_FORMAT_MOD_LINEAR"

2025-11-21T15:55:53.445 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::grabFrame()[599] TID:2041 "Framebuffer ID: 724 - Width: 3840 - Height: 2160  - DRM Format: XR24 - PixelFormat: BGR32, Modifier: DRM_FORMAT_MOD_LINEAR"

2025-11-21T15:55:54.444 |--|                   : <TRACE> grabber.screen.drm DRMFrameGrabber::grabFrame()[599] TID:2041 "Framebuffer ID: 724 - Width: 3840 - Height: 2160  - DRM Format: XR24 - PixelFormat: BGR32, Modifier: DRM_FORMAT_MOD_LINEAR"

and here are my system details for comparison:

Hyperion Server:
- Build:             GitHub-34958b46/da46e8b6-1763651575
- Build time:        Nov 20 2025 15:15:10
- Build type:        Debug
- Git Remote:        https://github.com/hyperion-project/hyperion.ng
- Version:           2.1.2-beta.1+PR1941
- UI Lang:           en (BrowserLang: en-GB)
- UI Access:         default
- Avail Screen Cap.: dispmanx,framebuffer,qt,drm
- Avail Video  Cap.: v4l2
- Avail Audio  Cap.: audio
- Avail Services:    boblight,cec,effectengine,forwarder,flatbuffer,protobuffer,mDNS,SSDP,borderdetection
- Config database:   /home/thomas/hyperion_pr1941/drm/db/hyperion.db
- Database:          read/write
- Mode:              Non-GUI

Hyperion Server OS:
- Distribution:      Debian GNU/Linux 13 (trixie)
- Architecture:      arm64
- CPU Type:          Raspberry Pi 4 Model B Rev 1.2
- CPU Revision:      b03112
- Kernel:            linux (6.12.47+rpt-rpi-v8 (WS: 64))
- Root/Admin:        true
- Qt Version:        6.8.2
- Python Version:    3.13.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants